import impl.RoleOperation;

public enum EnumForRole implements RoleOperation {
    ROOT_ADMIN("01", "系统管理员") {
        public String op() {
            return "拥有A权限";
        }
    },
    ORDER_ADMIN("02", "订单管理员") {
        public String op() {
            return "拥有B权限";
        }
    },
    NORMAL("03", "普通用户") {
        public String op() {
            return "拥有C权限";
        }
    };



    String code;
    String msg;

    EnumForRole(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static EnumForRole getRoleEnum(String code) {
        for (EnumForRole enumForRole : EnumForRole.values()) {
            if (code.equals(enumForRole.getCode())) {
                return enumForRole;
            }
        }
        return null;
    }


    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


}
